import request from '@/utils/request'

// export function login(data) {
//   return request({
//     url: '/vue-element-admin/user/login',
//     method: 'post',
//     data
//   })
// }

export function login(data) {
  return request({
    url: '/comctrl-auth/oauth/token',
    method: 'post',
    data
  })
}
export function getInfo(name) {
    return request({
      url: `/comctrl-admin/user/getByName/${name}`,
      method: 'get'
    })
  }

  export function getInfoById(id) {
    return request({
      url: `/comctrl-admin/user/getById/${id}`,
      method: 'get'
    })
  }
// export function getInfo(token) {
//   return request({
//     url: '/vue-element-admin/user/info',
//     method: 'get',
//     params: { token }
//   })
// }

//通过账号获取该账号关联的租户已经应用角色
export function getTenantRoleAppByUserId(id) {
  return request({
    url: `/comctrl-admin/user/getTenantRoleAppByUserId/${id}`,
    method: 'get'
  })
}

//获取租户下账号、应用、登录日志数量
export function getLoginInfo(data) {
  return request({
    url: '/comctrl-admin/user/getLoginInfo',
    method: 'get',
    params:data
  })
}
